package model.base.entities;

import oracle.jbo.server.EntityImpl;
import oracle.jbo.server.TransactionEvent;

public abstract class DeactivatableEnityObject extends EntityImpl {
    public DeactivatableEnityObject() {
        super();
    }
    
    public abstract void setActiveFlagColumn(boolean isActive);
    

    @Override
    protected void doDML(int operation, TransactionEvent transactionEvent) {
        if (operation == EntityImpl.DML_DELETE){          
          operation = EntityImpl.DML_UPDATE;
        }
          super.doDML(operation, transactionEvent);
        
    }


    @Override
    public void remove() {
        setActiveFlagColumn(false);
        super.remove();
    }
}
